package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;

import static org.jsola.hr.example.FormGroupFieldExample.*;

/**
 * 表单字段
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【表单字段】的参数")
@Data
public class SiteFieldAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_MODULE_NAME, example = E_MODULE_NAME, required = true)
    @NotNull(message = M_MODULE_NAME_NOT_NULL)
    @Length(max = 50, message = M_MODULE_NAME_MAX)
    private String moduleName;

    @ApiModelProperty(notes = N_MODULE_CODE, example = E_MODULE_CODE, required = true)
    @NotNull(message = M_MODULE_CODE_NOT_NULL)
    @Length(max = 30, message = M_MODULE_CODE_MAX)
    private String moduleCode;

    @ApiModelProperty(notes = N_FIELD_NAME, example = E_FIELD_NAME, required = true)
    @NotNull(message = M_FIELD_NAME_NOT_NULL)
    @Length(max = 32, message = M_FIELD_NAME_MAX)
    private String fieldName;

    @ApiModelProperty(notes = N_FIELD_TYPE, example = E_FIELD_TYPE, required = true)
    @NotNull(message = M_FIELD_TYPE_NOT_NULL)
    private Integer fieldType;

    @ApiModelProperty(notes = N_OPTIONS, example = E_OPTIONS)
    @Length(max = 2147483647, message = M_OPTIONS_MAX)
    private String options;

    @ApiModelProperty(notes = N_SORT, example = E_SORT, required = true)
    @NotNull(message = M_SORT_NOT_NULL)
    private Integer sort;


}

